Optimal. Leaf size=136 \[ \frac {b \left (b^2-2 c (a+c)\right ) \log \left (a+b \cos (x)+c \cos ^2(x)\right )}{2 c^4}-\frac {\cos (x) \left (b^2-c (a+2 c)\right )}{c^3}+\frac {\left (-2 b^2 c (2 a+c)+2 c^2 (a+c)^2+b^4\right ) \tanh ^{-1}\left (\frac {b+2 c \cos (x)}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3259, 1657, 634, 618, 206, 628} \[ -\frac {\cos (x) \left (b^2-c (a+2 c)\right )}{c^3}+\frac {b \left (b^2-2 c (a+c)\right ) \log \left (a+b \cos (x)+c \cos ^2(x)\right )}{2 c^4}+\frac {\left (-2 b^2 c (2 a+c)+2 c^2 (a+c)^2+b^4\right ) \tanh ^{-1}\left (\frac {b+2 c \cos (x)}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 1657
Rule 3259
Rubi steps
\begin {align*} \int \frac {\sin ^5(x)}{a+b \cos (x)+c \cos ^2(x)} \, dx &=-\operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^2}{a+b x+c x^2} \, dx,x,\cos (x)\right )\\ &=-\operatorname {Subst}\left (\int \left (\frac {b^2-c (a+2 c)}{c^3}-\frac {b x}{c^2}+\frac {x^2}{c}-\frac {-a^2 c-c^3+a \left (b^2-2 c^2\right )+b \left (b^2-2 c (a+c)\right ) x}{c^3 \left (a+b x+c x^2\right )}\right ) \, dx,x,\cos (x)\right )\\ &=-\frac {\left (b^2-c (a+2 c)\right ) \cos (x)}{c^3}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c}+\frac {\operatorname {Subst}\left (\int \frac {-a^2 c-c^3+a \left (b^2-2 c^2\right )+b \left (b^2-2 c (a+c)\right ) x}{a+b x+c x^2} \, dx,x,\cos (x)\right )}{c^3}\\ &=-\frac {\left (b^2-c (a+2 c)\right ) \cos (x)}{c^3}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c}+\frac {\left (b \left (b^2-2 c (a+c)\right )\right ) \operatorname {Subst}\left (\int \frac {b+2 c x}{a+b x+c x^2} \, dx,x,\cos (x)\right )}{2 c^4}-\frac {\left (b^4+2 c^2 (a+c)^2-2 b^2 c (2 a+c)\right ) \operatorname {Subst}\left (\int \frac {1}{a+b x+c x^2} \, dx,x,\cos (x)\right )}{2 c^4}\\ &=-\frac {\left (b^2-c (a+2 c)\right ) \cos (x)}{c^3}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c}+\frac {b \left (b^2-2 c (a+c)\right ) \log \left (a+b \cos (x)+c \cos ^2(x)\right )}{2 c^4}+\frac {\left (b^4+2 c^2 (a+c)^2-2 b^2 c (2 a+c)\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c \cos (x)\right )}{c^4}\\ &=\frac {\left (b^4+2 c^2 (a+c)^2-2 b^2 c (2 a+c)\right ) \tanh ^{-1}\left (\frac {b+2 c \cos (x)}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}-\frac {\left (b^2-c (a+2 c)\right ) \cos (x)}{c^3}+\frac {b \cos ^2(x)}{2 c^2}-\frac {\cos ^3(x)}{3 c}+\frac {b \left (b^2-2 c (a+c)\right ) \log \left (a+b \cos (x)+c \cos ^2(x)\right )}{2 c^4}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.57, size = 239, normalized size = 1.76 \[ \frac {3 c \cos (x) \left (c (4 a+7 c)-4 b^2\right )+\frac {6 \left (2 b^2 c (2 a+c)-2 b c (a+c) \sqrt {b^2-4 a c}+b^3 \sqrt {b^2-4 a c}-2 c^2 (a+c)^2-b^4\right ) \log \left (\sqrt {b^2-4 a c}-b-2 c \cos (x)\right )}{\sqrt {b^2-4 a c}}+\frac {6 \left (-2 b^2 c (2 a+c)-2 b c (a+c) \sqrt {b^2-4 a c}+b^3 \sqrt {b^2-4 a c}+2 c^2 (a+c)^2+b^4\right ) \log \left (\sqrt {b^2-4 a c}+b+2 c \cos (x)\right )}{\sqrt {b^2-4 a c}}+3 b c^2 \cos (2 x)+c^3 (-\cos (3 x))}{12 c^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.42, size = 491, normalized size = 3.61 \[ \left [-\frac {2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \cos \relax (x)^{3} - 3 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} \cos \relax (x)^{2} - 3 \, {\left (b^{4} - 4 \, a b^{2} c + 4 \, a c^{3} + 2 \, c^{4} + 2 \, {\left (a^{2} - b^{2}\right )} c^{2}\right )} \sqrt {b^{2} - 4 \, a c} \log \left (-\frac {2 \, c^{2} \cos \relax (x)^{2} + 2 \, b c \cos \relax (x) + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c \cos \relax (x) + b\right )}}{c \cos \relax (x)^{2} + b \cos \relax (x) + a}\right ) + 6 \, {\left (b^{4} c - 5 \, a b^{2} c^{2} + 8 \, a c^{4} + 2 \, {\left (2 \, a^{2} - b^{2}\right )} c^{3}\right )} \cos \relax (x) - 3 \, {\left (b^{5} - 6 \, a b^{3} c + 8 \, a b c^{3} + 2 \, {\left (4 \, a^{2} b - b^{3}\right )} c^{2}\right )} \log \left (c \cos \relax (x)^{2} + b \cos \relax (x) + a\right )}{6 \, {\left (b^{2} c^{4} - 4 \, a c^{5}\right )}}, -\frac {2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} \cos \relax (x)^{3} - 3 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} \cos \relax (x)^{2} - 6 \, {\left (b^{4} - 4 \, a b^{2} c + 4 \, a c^{3} + 2 \, c^{4} + 2 \, {\left (a^{2} - b^{2}\right )} c^{2}\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c \cos \relax (x) + b\right )}}{b^{2} - 4 \, a c}\right ) + 6 \, {\left (b^{4} c - 5 \, a b^{2} c^{2} + 8 \, a c^{4} + 2 \, {\left (2 \, a^{2} - b^{2}\right )} c^{3}\right )} \cos \relax (x) - 3 \, {\left (b^{5} - 6 \, a b^{3} c + 8 \, a b c^{3} + 2 \, {\left (4 \, a^{2} b - b^{3}\right )} c^{2}\right )} \log \left (c \cos \relax (x)^{2} + b \cos \relax (x) + a\right )}{6 \, {\left (b^{2} c^{4} - 4 \, a c^{5}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.33, size = 153, normalized size = 1.12 \[ -\frac {2 \, c^{2} \cos \relax (x)^{3} - 3 \, b c \cos \relax (x)^{2} + 6 \, b^{2} \cos \relax (x) - 6 \, a c \cos \relax (x) - 12 \, c^{2} \cos \relax (x)}{6 \, c^{3}} + \frac {{\left (b^{3} - 2 \, a b c - 2 \, b c^{2}\right )} \log \left (c \cos \relax (x)^{2} + b \cos \relax (x) + a\right )}{2 \, c^{4}} - \frac {{\left (b^{4} - 4 \, a b^{2} c + 2 \, a^{2} c^{2} - 2 \, b^{2} c^{2} + 4 \, a c^{3} + 2 \, c^{4}\right )} \arctan \left (\frac {2 \, c \cos \relax (x) + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.09, size = 344, normalized size = 2.53 \[ -\frac {\cos ^{3}\relax (x )}{3 c}+\frac {b \left (\cos ^{2}\relax (x )\right )}{2 c^{2}}+\frac {\cos \relax (x ) a}{c^{2}}-\frac {\cos \relax (x ) b^{2}}{c^{3}}+\frac {2 \cos \relax (x )}{c}-\frac {\ln \left (a +b \cos \relax (x )+c \left (\cos ^{2}\relax (x )\right )\right ) a b}{c^{3}}+\frac {\ln \left (a +b \cos \relax (x )+c \left (\cos ^{2}\relax (x )\right )\right ) b^{3}}{2 c^{4}}-\frac {b \ln \left (a +b \cos \relax (x )+c \left (\cos ^{2}\relax (x )\right )\right )}{c^{2}}-\frac {2 \arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right ) a^{2}}{c^{2} \sqrt {4 c a -b^{2}}}+\frac {4 \arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right ) b^{2} a}{c^{3} \sqrt {4 c a -b^{2}}}-\frac {4 \arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right ) a}{c \sqrt {4 c a -b^{2}}}-\frac {2 \arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right )}{\sqrt {4 c a -b^{2}}}-\frac {\arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right ) b^{4}}{c^{4} \sqrt {4 c a -b^{2}}}+\frac {2 \arctan \left (\frac {b +2 c \cos \relax (x )}{\sqrt {4 c a -b^{2}}}\right ) b^{2}}{c^{2} \sqrt {4 c a -b^{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.41, size = 197, normalized size = 1.45 \[ \cos \relax (x)\,\left (\frac {a}{c^2}+\frac {2}{c}-\frac {b^2}{c^3}\right )-\frac {{\cos \relax (x)}^3}{3\,c}-\frac {\ln \left (c\,{\cos \relax (x)}^2+b\,\cos \relax (x)+a\right )\,\left (8\,a^2\,b\,c^2-6\,a\,b^3\,c+8\,a\,b\,c^3+b^5-2\,b^3\,c^2\right )}{2\,\left (4\,a\,c^5-b^2\,c^4\right )}+\frac {b\,{\cos \relax (x)}^2}{2\,c^2}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,\cos \relax (x)}{\sqrt {4\,a\,c-b^2}}\right )\,\left (2\,a^2\,c^2-4\,a\,b^2\,c+4\,a\,c^3+b^4-2\,b^2\,c^2+2\,c^4\right )}{c^4\,\sqrt {4\,a\,c-b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________